package com.chuanyang.driverh.mainhome.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.chuanyang.driverh.R;
import com.chuanyang.driverh.response2.join.EvaluateListBean;

import java.util.List;

/**
 * 相思无用，唯别而已。别期若有定，千般煎熬又何如，莫道黯然销魂，何处柳暗花明。
 * Created by sky on 2016/8/12.
 */
public class DriverEvaluateMotorcadeAdapter extends BaseAdapter {

    private List<EvaluateListBean> driverPageEvaluatesBeanList;
    private LayoutInflater mInflater;
    private Context mContext;

    public DriverEvaluateMotorcadeAdapter(Context activity, List<EvaluateListBean> orderWaitConfirmList) {
        driverPageEvaluatesBeanList = orderWaitConfirmList;
        mContext = activity;
        mInflater = LayoutInflater.from(activity);
    }

    @Override
    public int getCount() {
        return driverPageEvaluatesBeanList.size();
    }

    @Override
    public Object getItem(int position) {
        return driverPageEvaluatesBeanList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.item_evaluate_driver, null);
            holder = new ViewHolder();
            holder.tv_driver_name = (TextView) convertView.findViewById(R.id.tv_driver_name);
            holder.tv_driver_evaluate_time = (TextView) convertView.findViewById(R.id.tv_driver_evaluate_time);
            holder.tv_driver_evaluate = (TextView) convertView.findViewById(R.id.tv_driver_evaluate);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        //holder.tv_goods_name_modification.setText(goodsEntities.get(position).getGoodsName());
        //holder.iv_bank_card_icon.setImageResource(R.mipmap.ic_launcher);
        holder.tv_driver_name.setText("中国工商银行");
        holder.tv_driver_evaluate_time.setText("6222******4568");
        holder.tv_driver_evaluate.setText("储蓄卡");
        return convertView;
    }

    public class ViewHolder {
        public ImageView iv_evaluate_driver;
        public TextView tv_driver_name;
        public TextView tv_driver_evaluate_time;
        public TextView tv_driver_evaluate;
    }
}
